package com.sifa.springcloud.controller;

import com.sifa.springcloud.entities.CommentResult;
import com.sifa.springcloud.entities.Payment;
import com.sifa.springcloud.service.PaymentServiceFeign;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@Slf4j
public class OrderFeignController {
    @Resource
    private PaymentServiceFeign paymentServiceFeign;

    @GetMapping("consumer/payment/get/{id}")
    public CommentResult<Payment> getPaymentByID(@PathVariable("id") Integer id ){
        return  paymentServiceFeign.getPayment(id);
    }

    @GetMapping("11111")
    public String timeOutTest() throws InterruptedException {
        Thread.sleep(3000);
        return "1111";
    }
}
